use proc_macro::TokenStream;
use quote::quote;
use syn::{parse_macro_input, DeriveInput};

mod gpio;

#[proc_macro_attribute]
pub fn io_group(attr: TokenStream, item: TokenStream) -> TokenStream {
    let input = parse_macro_input!(item as DeriveInput);
    let name = &input.ident;
    let attr = attr.to_string();
    let sc = gpio::create(&attr);
    let expand = quote! {

        #input

        impl #name {

            #sc
        }
    };

    TokenStream::from(expand)
}

